/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cassandrawindow;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 *
 * @author MT140QuyenNB
 */

public class TestThread implements Runnable{
    
    //String[] keys ;
    List<String> values = new ArrayList<String>();
    List<String> keys = new ArrayList<String>();
    //String[] values;
    int start_count = 0;
    int finish_count = 0;    
    Thread runner;

    public TestThread(List<String> Valus,  List<String> keyValues,int count_b,int count_f)
    {
        keys = keyValues;
        values = Valus;
        start_count = count_b;
        finish_count = count_f;
        
        runner = new Thread(this);
        runner.start();
    }

    public void run()
    {
        while(true)
        {
            try {
                Thread.sleep(20*60*1000);
                TestThread1 tt1 = new TestThread1();
                TestThread2 tt2 = new TestThread2();
                TestThread3 tt3 = new TestThread3();
                TestThread4 tt4 = new TestThread4();

            } catch (Exception ex){}
        }
    }

    public static boolean checkTime(int hour, int minute)
    {
            boolean check = false;

            Date date = new Date();   // given date
            Calendar calendar = GregorianCalendar.getInstance(); // creates a new calendar instance
            calendar.setTime(date);   // assigns calendar to given date
            calendar.get(Calendar.HOUR_OF_DAY); // gets hour in 24h format
            calendar.get(calendar.MINUTE);
            calendar.get(calendar.SECOND);

            if ((calendar.get(Calendar.HOUR_OF_DAY) == hour)&&(calendar.get(calendar.MINUTE) == minute))
            {
                check = true;
            }
            return check;
    }

    public static int getHour()
    {
            Date date = new Date();   // given date
            Calendar calendar = GregorianCalendar.getInstance(); // creates a new calendar instance
            calendar.setTime(date);   // assigns calendar to given date

            return calendar.get(Calendar.HOUR_OF_DAY);
    }

}

